WPS Office.apk(点击下载) / gwq.java


package defpackage;

import cn.wps.moffice.OfficeApp;
import cn.wps.moffice_eng.R;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
import defpackage.fyz;
import java.io.IOException;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;

/* renamed from: gwq  reason: default package */
public final class gwq {
    private static gwq hGU;
    boolean gLs = false;
    public long hGO;

    /* renamed from: gwq$a */
    public interface a {
        void km(boolean z);
    }

    /* access modifiers changed from: package-private */
    /* renamed from: gwq$b */
    public class b extends fcv<String, Void, Boolean> {
        a hGV;

        public b(a aVar) {
            this.hGV = aVar;
        }

        private Boolean atP() {
            try {
                return Boolean.valueOf(bVY());
            } catch (Exception e) {
                e.printStackTrace();
                return false;
            }
        }

        private boolean bVY() throws IOException, JSONException {
            HashMap hashMap = new HashMap();
            hashMap.put(SpeechConstant.IST_SESSION_ID, ebo.arU() ? fok.bBq().getWPSSid() : "");
            OfficeApp arx = OfficeApp.arx();
            String f = lwd.f("https://moapi.wps.cn/msg/api/p/message/unread/newmessage" + lwv.a("?version=%s&channel=%s&pchannel=%s&position=%s&time=%s", arx.getString(R.string.app_version), arx.arA(), arx.arB(), "msgcenter", Long.valueOf(fyz.xj(fyz.a.gIZ).b((fyx) fva.PUBLIC_MESSAGECENTER_NEWMSGTIME_Q, 0L))), hashMap);
            if (f != null) {
                try {
                    JSONObject jSONObject = new JSONObject(f);
                    if (jSONObject.optInt(SpeechUtility.TAG_RESOURCE_RESULT) == 0) {
                        gwq.this.hGO = System.currentTimeMillis();
                        fyz.xj(fyz.a.gIZ).a(fva.PUBLIC_MESSAGECENTER_NEWMSGTIME_S, jSONObject.optLong("time"));
                        return jSONObject.optBoolean("notice");
                    }
                } catch (JSONException e) {
                    throw e;
                }
            }
            return false;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object[]] */
        /* access modifiers changed from: protected */
        @Override // defpackage.fcv
        public final /* synthetic */ Boolean doInBackground(String[] strArr) {
            return atP();
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        /* access modifiers changed from: protected */
        @Override // defpackage.fcv
        public final /* synthetic */ void onPostExecute(Boolean bool) {
            this.hGV.km(bool.booleanValue());
            gwq.this.gLs = false;
        }

        /* access modifiers changed from: protected */
        @Override // defpackage.fcv
        public final void onPreExecute() {
        }
    }

    public static gwq bVX() {
        if (hGU == null) {
            hGU = new gwq();
        }
        return hGU;
    }

    public final synchronized void a(a aVar) {
        if (!this.gLs && Math.abs(System.currentTimeMillis() - this.hGO) >= gwn.d(5, fvd.bP("member_messagecenter", "newmessage_update")) * 60 * 1000) {
            this.gLs = true;
            new b(aVar).execute(new String[0]);
        }
    }
}